package com.book.pojo;

import java.util.Objects;

public class BookDetail {
    private int id;
    public String intrucduce;

    private String bookISBN;

    private String publisher;
    private String author;
    private int page;

    public BookDetail() {
    }

    public BookDetail(int id, String intrucduce, String bookISBN, String publisher, String author, int page) {
        this.id = id;
        this.intrucduce = intrucduce;
        this.bookISBN = bookISBN;
        this.publisher = publisher;
        this.author = author;
        this.page = page;
    }

    @Override
    public String toString() {
        return "BookDetail{" +
                "id=" + id +
                ", intrucduce='" + intrucduce + '\'' +
                ", bookISBN='" + bookISBN + '\'' +
                ", publisher='" + publisher + '\'' +
                ", author='" + author + '\'' +
                ", page=" + page +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBookISBN() {
        return bookISBN;
    }

    public void setBookISBN(String bookISBN) {
        this.bookISBN = bookISBN;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public String getIntrucduce() {
        return intrucduce;
    }

    public void setIntrucduce(String intrucduce) {
        this.intrucduce = intrucduce;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BookDetail that = (BookDetail) o;

        if (id != that.id) return false;
        if (page != that.page) return false;
        if (!Objects.equals(intrucduce, that.intrucduce)) return false;
        if (!Objects.equals(bookISBN, that.bookISBN)) return false;
        if (!Objects.equals(publisher, that.publisher)) return false;
        return Objects.equals(author, that.author);
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (intrucduce != null ? intrucduce.hashCode() : 0);
        result = 31 * result + (bookISBN != null ? bookISBN.hashCode() : 0);
        result = 31 * result + (publisher != null ? publisher.hashCode() : 0);
        result = 31 * result + (author != null ? author.hashCode() : 0);
        result = 31 * result + page;
        return result;
    }
}
